/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.frame.sulent.datasource.common;

public class DataSourceConstants {

    public static final String DATASOURCE = "datasource";

    /**
     * driver
     */
    //public static final String ORG_POSTGRESQL_DRIVER = "org.postgresql.Driver";
    public static final String ORG_POSTGRESQL_DRIVER = "shade.org.postgresql.Driver"; //与mrs的冲突,改用重命名的驱动包
    public static final String ORG_TBASE_DRIVER = "shade.org.postgresql.Driver"; //与mrs的冲突,改用重命名的驱动包
    public static final String COM_MYSQL_CJ_JDBC_DRIVER = "com.mysql.cj.jdbc.Driver";
    public static final String COM_MYSQL_JDBC_DRIVER = "com.mysql.jdbc.Driver";
    public static final String ORG_APACHE_HIVE_JDBC_HIVE_DRIVER = "org.apache.hive.jdbc.HiveDriver";
    public static final String COM_CLICKHOUSE_JDBC_DRIVER = "com.clickhouse.jdbc.ClickHouseDriver";
    public static final String COM_ORACLE_JDBC_DRIVER = "oracle.jdbc.OracleDriver";
    public static final String COM_SQLSERVER_JDBC_DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
    public static final String COM_DB2_JDBC_DRIVER = "com.ibm.db2.jcc.DB2Driver";
    public static final String COM_PRESTO_JDBC_DRIVER = "com.facebook.presto.jdbc.PrestoDriver";
    public static final String COM_REDSHIFT_JDBC_DRIVER = "com.amazon.redshift.jdbc42.Driver";
    public static final String COM_ATHENA_JDBC_DRIVER = "com.simba.athena.jdbc.Driver";
    public static final String COM_KINGBASE8_JDBC_DRIVER = "com.kingbase8.Driver";
    public static final String COM_DM_JDBC_DRIVER = "dm.jdbc.driver.DmDriver";
    public static final String ORG_GAUSSDB_DRIVER = "com.huawei.opengauss.jdbc.Driver";
    public static final String ORG_GAUSSDWS_DRIVER = "com.huawei.gauss200.jdbc.Driver";
    public static final String IO_JESTCLIENT_DRIVER = "io.searchbox.client.JestClient";
    public static final String OSCAR_JDBC_DRIVER = "com.oscar.Driver";


    /**
     * validation Query
     */
    public static final String POSTGRESQL_VALIDATION_QUERY = "select version()";
    public static final String TBASE_VALIDATION_QUERY = "select version()";
    public static final String MYSQL_VALIDATION_QUERY = "select 1";
    public static final String HIVE_VALIDATION_QUERY = "select 1";
    public static final String CLICKHOUSE_VALIDATION_QUERY = "select 1";
    public static final String ORACLE_VALIDATION_QUERY = "select 1 from dual";
    public static final String SQLSERVER_VALIDATION_QUERY = "select 1";
    public static final String DB2_VALIDATION_QUERY = "select 1 from sysibm.sysdummy1";
    public static final String PRESTO_VALIDATION_QUERY = "select 1";
    public static final String REDSHIFT_VALIDATION_QUERY = "select 1";
    public static final String ATHENA_VALIDATION_QUERY = "select 1";
    public static final String KINGBASE8_VALIDATION_QUERY = "select version()";
    public static final String DM_VALIDATION_QUERY = "select 1";
    public static final String GAUSSDB_VALIDATION_QUERY = "select version()";
    public static final String GAUSSDWS_VALIDATION_QUERY = "select version()";
    public static final String OSCAR_VALIDATION_QUERY = "select 1";


    /**
     * jdbc url
     */
    public static final String JDBC_MYSQL = "jdbc:mysql://";
    public static final String JDBC_POSTGRESQL = "jdbc:postgresql://";
    public static final String JDBC_TBASE = "jdbc:postgresql://";
    public static final String JDBC_HIVE_2 = "jdbc:hive2://";
    public static final String JDBC_CLICKHOUSE = "jdbc:clickhouse://";
    public static final String JDBC_ORACLE_SID = "jdbc:oracle:thin:@";
    public static final String JDBC_ORACLE_SERVICE_NAME = "jdbc:oracle:thin:@//";
    public static final String JDBC_SQLSERVER = "jdbc:sqlserver://";
    public static final String JDBC_DB2 = "jdbc:db2://";
    public static final String JDBC_PRESTO = "jdbc:presto://";
    public static final String JDBC_REDSHIFT = "jdbc:redshift://";
    public static final String JDBC_ATHENA = "jdbc:awsathena://";
    public static final String JDBC_KINGBASE8 = "jdbc:kingbase8://";
    public static final String JDBC_DM = "jdbc:dm://";
    public static final String JDBC_GAUSSDB = "jdbc:opengauss://";
    public static final String JDBC_GAUSSDWS = "jdbc:gaussdb://";
    public static final String JDBC_MONGODB = "mongodb://";
    public static final String JDBC_FTP = "ftp://";
    public static final String JDBC_SFTP = "sftp://";
    public static final String JDBC_OSCAR = "jdbc:oscar://";
    public static final String JDBC_HDFS = "hdfs://";


    /**
     * database type
     */
    public static final String MYSQL = "MYSQL";
    public static final String HIVE = "HIVE";
    public static final String ORACLE = "ORACLE";
    public static final String POSTGRESQL = "POSTGRESQL";

    /**
     * dataSource sensitive param
     */
    public static final String DATASOURCE_PASSWORD_REGEX =
            "(?<=((?i)password((\":\")|(=')))).*?(?=((\")|(')))";

    /**
     * datasource encryption salt
     */
    //public static final String DATASOURCE_ENCRYPTION_SALT_DEFAULT = "!@#$%^&*";
    public static final String DATASOURCE_ENCRYPTION_ENABLE = "datasource.encryption.enable";
    //public static final String DATASOURCE_ENCRYPTION_SALT = "datasource.encryption.salt";
    public static final String DATASOURCE_ENCRYPTION_RSA_PRIVATE_KEY = "datasource.encryption.rsa.private_key";
    public static final String DATASOURCE_ENCRYPTION_RSA_PUBLIC_KEY= "datasource.encryption.rsa.public_key";
    public static final String DATASOURCE_ENCRYPTION_RSA_PRIVATE_KEY_DEFAULT = "MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A==";
    public static final String DATASOURCE_ENCRYPTION_RSA_PUBLIC_KEY_DEFAULT = "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANL378k3RiZHWx5AfJqdH9xRNBmD9wGD2iRe41HdTNF8RUhNnHit5NpMNtGL0NPTSSpPjjI1kJfVorRvaQerUgkCAwEAAQ==";

    /**
     * datasource config
     */
    public static final String SPRING_DATASOURCE_MIN_IDLE = "spring.datasource.minIdle";

    public static final String SPRING_DATASOURCE_MAX_ACTIVE = "spring.datasource.maxActive";

    public static final String SPRING_DATASOURCE_TEST_ON_BORROW = "spring.datasource.testOnBorrow";

    public static final String HOST = "host";

    public static final String PORT = "port";

    public static final String PROTOCOL = "protocol";

    public static final String DIRECTORY = "directory";

    public static final String USERNAME = "username";

    public static final String PASSWORD = "password";

    public static final String ENDPOINT = "endpoint";

    public static final String BUCKET_NAME = "bucketName";
}
